package com.taotao.manage.controller.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.taotao.manage.pojo.Item;
import com.taotao.manage.service.ItemDescService;
import com.taotao.manage.service.ItemService;

@Controller
@RequestMapping("item")
public class ApiItemController {
	
	@Autowired
	ItemService itemService;
	
	@Autowired
	ItemDescService itemDescService;
	
	@GetMapping("{itemId}")
	public ResponseEntity<Item> queryItemById(@PathVariable("itemId") Long itemId){
		Item item = itemService.queryById(itemId);
		return ResponseEntity.status(HttpStatus.OK).body(item);
	}
	
	
}












